
import os
import project

#NOTE: Every mailing list should be in MBOX format, and each list should have a subdirectory
#      in the mailFolder dir
def start(proj, log):
    #find mbox folder and validate some mboxes exist
    if proj.has_key('mailDir'):
        mailDir = proj.projectDir + proj['mailDir']
        if len(os.listdir(mailDir)) > 0:
            log.write("mailDir is given and points to a directory with some content.")
            return
        else: 
            raise project.ProjectError("mailDir seems to be empty")
    else:
        raise project.ProjectParameterError("mailDir")
 
